<template>
  <div>
    <h1>hello</h1>
    <home :pmsg="pmsg" @myevent="getData"></home>
    <about ref="myabout"></about>
    <button @click="getAbout">getAbout</button>
  </div>
</template>

<script>
  import Vue from 'vue'
  //引入组件
  import Home from "./views/Home"
  import about from "./views/About"
  //全局注册组件
  Vue.component("home",Home)
  export default {
    data() {
      return {
        pmsg:"父组件的东西"
      }
    },
    components:{about},
    methods: {
      getData(val){
        console.log(val)
      },
      getAbout(){
        console.log(this.$refs)
      }
    },
      
  }
</script>

<style lang="scss">
</style>
